@include('layout.header')
<div class="layui-body">
    <div class="box-header with-border">
        <div style="font-size: 20px">角色列表</div>
        <form action="{{route('admin.showrole', ['user'=>$user->id])}}" method="POST">
            <div class="form-group">

                @foreach($roles as $role)
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="roles[]"
                                   @if($myRoles->contains($role))
                                   checked
                                   @endif
                                   value="{{$role->id}}">
                            {{$role->name}}
                        </label>
                    </div>
                @endforeach
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
</div>
@include('layout.footer')